// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    "city":"成都",
    realtime:{},
    date:{}
  },

  lifea(){
    wx.navigateTo({
      url: '/pages/life/life',
    })
  },
  // 事件处理函数
 
  onLoad:function() {
    var self=this
  wx.request({
    url: 'http://apis.juhe.cn/simpleWeather/query?city=成都&key=3032902522e98cb3282b6dd2e278a188', 
    success (res) {
      self.setData({
        realtime:res.data.result.realtime,
        date:res.data.result.future[0]
      })
    },
    fail:function(info){
      console.log(info)
    }
  })
      }
     })